# encoding: utf-8
from flask import render_template, redirect, url_for
from . import user
from ..models import User
from flask_login import login_required

@user.route("/list")
@login_required
def list():
    users = User.getList().get("list")
    return render_template("user_list.html", list=users)

@user.route("/upgradeStatus/<int:id>")
@login_required
def upgradeStatus(id):
    # 修改用户状态
    User.upgradeStatusById(id)
    return redirect(url_for("user.list"))